import { bannerlist } from '../../api/api'

const state = {
  bannerListData: []

}
const getters = {
  getbannerlist (state) {
    return state.bannerListData
  }

}
const mutations = {
  REQ_BANNERLIST (state, payload) {
    state.bannerListData = payload
  }

}
// 调用接口
const actions = {
  getBanner ({ commit }) {
    bannerlist().then(res => {
      commit('REQ_BANNERLIST', res.list)
    })
  }

}

export default {
// 命名空间
  namespaced: true,
  actions,
  mutations,
  getters,
  state
}
